# -*- coding: cp936 -*-
#parse


import urllib
import urllib2
def url_parse(url_str):
    if "GET" in url_str[0:5]:
        url = url_str.split("HTTP")[0].split("GET")[1]
        #url = url_str.splitlines()[0]
        #data = urllib2.urlopen(url).read()
	data = urllib.urlopen(url).read()
        return data
        
        
    elif "POST" in url_str[0:5]:
        url = url_str.split("HTTP")[0].split("POST")[1]
        data = urllib2.urlopen(url).read()
        return data
    else:
        pass
        

if __name__ == "__main__":
    pass
    
